<?php

namespace App\Logic;
use App\Server\AreaModel;

/**
 * Created by PhpStorm.
 * User: hanbin
 * Date: 17/3/29
 * Time: 下午11:26
 */
class AreaLogic
{
    public static function getList($page = 10,$field = null,$last_id = 1,$so = []){
        $result = AreaModel::getList($page, $field, $last_id,$so);
        if($result){
            $list = $result['data'];
            if($list){
                $data = [];
                foreach ($list as $k => $v){
                    $item = [];
                    $item['id'] = $v['id'];
                    $item['name'] = $v['name'];
                    $data[] = $item;
                }
                $result['data'] = $data;
            }
        }
        return $result;
    }

}